package xyj.sparrow.scheduler.conf;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyj.sparrow.scheduler.cron.ops.LocalMessageSync;
import xyj.sparrow.scheduler.cron.ops.MessageSync;
import xyj.sparrow.scheduler.server.connect.ConnectManager;
import xyj.sparrow.scheduler.server.connect.LocalConnectManager;

/**
 * 单机组件
 *
 * @author 江南小俊
 * @since 2021/6/22
 **/
@Configuration
@ConditionalOnProperty(prefix = "xyj.sparrow", name = "mode", havingValue = "single")
public class LocalAutoConfiguration {
    @Bean
    public MessageSync localMessageSync() {
        return new LocalMessageSync();
    }

    @Bean
    public ConnectManager localConnectManager() {
        return new LocalConnectManager();
    }
}
